#include "RegularGrammaticaTest.h"

RegularGrammaticaTest::RegularGrammaticaTest()
{
}

RegularGrammaticaTest::~RegularGrammaticaTest()
{
}

void RegularGrammaticaTest::testProgram()
{
	cout<<"Regular Grammatica Test"<<endl << "==================================="<<endl<<endl;
	
	set<string> helpSymbols;
	
	set<char> alphabet;
	
	set<ProductionRule<string> > rules;
	rules.insert(ProductionRule <string>("q0", 'e', "q1"));
	rules.insert(ProductionRule <string>("q1", 'r', "q2"));
	rules.insert(ProductionRule <string>("q2", 'i', "q3"));
	rules.insert(ProductionRule <string>("q2", 'i'));
	rules.insert(ProductionRule <string>("q3", 'k', "q4"));
	rules.insert(ProductionRule <string>("q3", 'c'));
	rules.insert(ProductionRule <string>("q3", 'k'));
	rules.insert(ProductionRule <string>("q4", 'j', "q5"));
	rules.insert(ProductionRule <string>("q5", 'e'));
	
	RegGrammatica<string> *regGrammatica = new RegGrammatica<string>(helpSymbols, alphabet, rules, "q0");

	//De productieregels
	cout << *regGrammatica << endl;
	cout << "Genereren de volgende woorden: ";
	set<string> regularLanguage = regGrammatica->getLanguage(10);
	cout <<regularLanguage<<endl<<endl;
	
		
	cout << "Einde Regular Grammatica test" <<endl;
}
